import Search from 'models/search';

export default class FileDataSearch extends Search {
  fileName = '';

  propertyList = ['fileName'];

  constructor() {
    super();
    this.setOldData();
  }

  getObject(pagination) {
    let postData = {};
    let fileName = this.fileName;
    if (fileName.trim() !== '') {
      postData.fileName = fileName;
    }

    if (pagination !== undefined) {
      let {
        limit,
        page
      } = pagination.getObject();
      postData.limit = limit;
      postData.page = page;
    }

    return postData;
  }
}
